package com.chen.app.user.service.impl;

import com.chen.app.datasource.DataSource;
import com.chen.app.datasource.DataSourceNames;
import com.chen.app.user.entity.TbUser;
import com.chen.app.user.mapper.TbUserMapper;
import com.chen.app.user.service.ITbUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-10-10
 */
@Service
public class TbUserServiceImpl extends ServiceImpl<TbUserMapper, TbUser> implements ITbUserService {


    @Override
    public TbUser findUserByFirstDb(long id) {
        return this.baseMapper.selectById(id);
    }

    @DataSource(name = DataSourceNames.SECOND)
    @Override
    public TbUser findUserBySecondDb(long id) {
        return this.baseMapper.selectById(id);
    }
}
